package com.nimt.hqgl_idea.util;

/*封装响应报文中的响应体*/
public class ResponseBody {
    /*定义结果码*/
    private Integer code;
    /*定义错误信息*/
    private Object msg;
    /*定义数据*/
    private  Object data;

    /*构造成功的ResponseBody*/
    public ResponseBody(Object data){
        this.code = 10000;
        this.data = data;
    }

    /*构造错误的ResponseBody*/
    public ResponseBody(ErrorEnum error){
        this.code = error.getCode();
        this.msg = error.getMsg();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getMsg() {
        return msg;
    }

    public void setMsg(Object msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
